import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { StudentVo } from '../vo/studentvo';

@Injectable()
export class StudentService {

  constructor(private http:HttpClient) { }


  private getAnObjectUrl="http://localhost/getAnObject";

  getAnObject(){

    return this.http.get(this.getAnObjectUrl).toPromise();
  }

  private addStudentUrl="http://localhost/saveStudentInfo";

addStudentInfo(svo:StudentVo){
let p={
	"xm":svo.xm,
	"sfzh":svo.sfzh,
	"xh":svo.xh
}

return this.http.post(this.addStudentUrl,p).toPromise();



}



}